<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>

<div class="t_bar"> <span class="color_red">*</span>
	核心成员
</div>
<table  id="tblorg_hxcy" cellpadding="0" class="table01 t_css" width="100%" border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;">
	<thead >
	<tr style="border:1px solid #B7D1E6">
		<th class="TblHead" align="center"  width="5%">选择</th>
		<th class="TblHead" align="center"  width="5%">序号</th>
		<th class="TblHead" align="center"  width="10%">姓名</th>
		<th class="TblHead" align="center"  width="10%">性别</th>
		<th class="TblHead" align="center"  width="10%">年龄</th>
		<th class="TblHead" align="center"  width="10%">职称</th>
		<th class="TblHead" align="center"  width="10%">学历</th>
		<th class="TblHead" align="center"  width="10%">研究专长</th>
		<th class="TblHead" align="center"  width="10%">联系方式</th>
	</tr>
	</thead>
	<tbody id="tab">
	<tr style="display:none">
		<td align="center">
			<input type="radio" style="border: 0px;background-color: white;" class="radiobutton" name="selorg_hxcy" >
		</td>
		<td align="center">
			<span name="office_hxcys|office_hxcy[0]@seq_no" >[index]</span>
		</td>
		<td align="center">
			<input  id="office_hxcy_name_[0]" name="office_hxcys|office_hxcy[0]|office_hxcy_name" label="姓名"
					 value="" maxlength="30" class=" required input_text" style="width:75%"  />
		</td>
		<td align="center">
			<input  id="office_hxcy_sex_[0]" name="office_hxcys|office_hxcy[0]|office_hxcy_sex" label="性别" maxlength="1" value="" class=" required input_text" style="width:80%"  />
		</td>
		<td align="center">
			<input  id="office_hxcy_age_[0]" name="office_hxcys|office_hxcy[0]|office_hxcy_age" label="年龄" onfocus="InitInput.setNumber(this,3,0,0)"   value="" class="required  input_text" style="width:80%;text-align: right; "  />
		</td>
		<td align="center">
			<input  id="office_hxcy_positional_[0]" name="office_hxcys|office_hxcy[0]|office_hxcy_positional" label="职称" value="" maxlength="30" class=" required input_text" style="width:80%"  />
		</td>
		<td align="center">
			<input  id="office_hxcy_education_name_[0]" name="office_hxcys|office_hxcy[0]|office_hxcy_education_name" label="学历" value="" maxlength="30" class=" required input_text" style="width:80%"  />
		</td>
		<td align="center">
			<input  id="office_hxcy_research_expertise_[0]" name="office_hxcys|office_hxcy[0]|office_hxcy_research_expertise" label="研究专长" value="" maxlength="50" class=" required input_text" style="width:80%"  />
		</td>
		<td align="center">
			<input  id="office_hxcy_contact_way_[0]" name="office_hxcys|office_hxcy[0]|office_hxcy_contact_way" label="联系方式" value="" maxlength="30" class=" required input_text" style="width:80%"  />
		</td>
	</tr>


	<c:set value="0" var="index" scope="page"/>
	<x:forEach select="$xmlData/data/office_hxcys/office_hxcy" var="office_hxcy">

		<c:choose>
			<c:when test="${index<10}" ><c:set value="0" var="flag" scope="page"/></c:when>
			<c:otherwise><c:set value="" var="flag" scope="page"/></c:otherwise>
		</c:choose>
		<tr >
			<td align="center">
				<input type="radio" style="border: 0px;background-color: white;" class="radiobutton" name="selorg_hxcy" >
			</td>
			<td align="center">
				<span   name="office_hxcys/office_hxcy[${flag}${index}]@seq_no" ><x:out select="$office_hxcy/@seq_no"/></span>
			</td>
			<td align="center">
				<input  id="office_hxcy_name_[${flag}${index}]" name="office_hxcys/office_hxcy[${flag}${index}]/office_hxcy_name"
						label="姓名"  maxlength="30" value="<x:out select="$office_hxcy/office_hxcy_name"/>" class=" required input_text" style="width:75%"  />
			</td>
			<td align="center">
				<input  id="office_hxcy_sex_[${flag}${index}]" name="office_hxcys/office_hxcy[${flag}${index}]/office_hxcy_sex" label="性别" maxlength="1" value="<x:out select="$office_hxcy/office_hxcy_sex"/>" class=" required input_text" style="width:80%"  />
			</td>
			<td align="center">
				<input  id="office_hxcy_age_[${flag}${index}]" name="office_hxcys/office_hxcy[${flag}${index}]/office_hxcy_age" label="年龄" onfocus="InitInput.setNumber(this,3,0,0)"  value="<x:out select="$office_hxcy/office_hxcy_age"/>" class="required  input_text" style="width:80%;text-align: right; "  />
			</td>
			<td align="center">
				<input  id="office_hxcy_positional_[${flag}${index}]" name="office_hxcys/office_hxcy[${flag}${index}]/office_hxcy_positional" label="职称" value="<x:out select="$office_hxcy/office_hxcy_positional"/>" maxlength="30" class=" required input_text" style="width:80%"  />
			</td>

			<td align="center">
				<input  id="office_hxcy_education_name_[${flag}${index}]" name="office_hxcys/office_hxcy[${flag}${index}]/office_hxcy_education_name" label="学历" value="<x:out select="$office_hxcy/office_hxcy_education_name"/>" maxlength="30" class=" required input_text" style="width:80%"  />
			</td>
			<td align="center">
				<input  id="office_hxcy_research_expertise_[${flag}${index}]" name="office_hxcys/office_hxcy[${flag}${index}]/office_hxcy_research_expertise" label="研究专长" value="<x:out select="$office_hxcy/office_hxcy_research_expertise"/>" maxlength="50" class=" required input_text" style="width:80%"  />
			</td>
			<td align="center">
				<input  id="office_hxcy_contact_way_[${flag}${index}]" name="office_hxcys/office_hxcy[${flag}${index}]/office_hxcy_contact_way" label="联系方式" value="<x:out select="$office_hxcy/office_hxcy_contact_way"/>" maxlength="30" class=" required input_text" style="width:80%"  />
			</td>
		</tr>
		<c:set value="${index+1}" var="index" scope="page"/>
	</x:forEach>
	</tbody>
</table>

<table id="jbutton" width="98%" align="center" border="0" cellspacing="0" cellpadding="0" style="border:0;">
	<tr ><td>
		<input class="button_02" id="tianjia" name="cmdAddbefore" type=button value="添加" onclick="if(checkTabLimit('tblorg_hxcy',30,'核心成员信息最多只能填写30条')){addNewRow('tblorg_hxcy');showDateTag('tblorg_hxcy');}try{top.resizeFrame();}catch(e){};changeCss();getLen();attachCheckBuyWay(this.id)">
		<input class="button_02" name="cmdMovePrev" type=button value="上移" onclick="movePrev('tblorg_hxcy','selorg_hxcy');changeCss();">
		<input class="button_02" name="cmdMoveNext" type=button value="下移" onclick="moveNext('tblorg_hxcy','selorg_hxcy');changeCss();">
		<input class="button_02" name="cmddel" type=button  value="删除" onclick="deleteSelectedRow('tblorg_hxcy','核心成员信息');changeCss();getLen();attachCheckBuyWay(this.id)">
        <input type='hidden'  name="proposal/total_num_new" id="yqjfjs" value="<x:out select="$xmlData/data/proposal/total_num_new" />">

    </td></tr>
</table>



<div class="t_bar">
	外单位专家
</div>
<table  id="tblor_wdwzj" cellpadding="0" class="table01 t_css" width="100%" border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;">
	<thead >
	<tr style="border:1px solid #B7D1E6">
		<th class="TblHead" align="center"  width="5%">选择</th>
		<th class="TblHead" align="center"  width="5%">序号</th>
		<th class="TblHead" align="center"  width="10%">姓名</th>
		<th class="TblHead" align="center"  width="10%">性别</th>
		<th class="TblHead" align="center"  width="10%">年龄</th>
		<th class="TblHead" align="center"  width="10%">职称</th>
		<th class="TblHead" align="center"  width="10%">学历</th>
		<th class="TblHead" align="center"  width="10%">研究专长</th>
		<th class="TblHead" align="center"  width="10%">联系方式</th>
	</tr>
	</thead>
	<tbody id="tab1">
	<tr style="display:none">
		<td align="center">
			<input type="radio" style="border: 0px;background-color: white;" class="radiobutton" name="selorg_wdwzj" >
		</td>
		<td align="center">
			<span name="office_wdwzjs|office_wdwzj[0]@seq_no" >[index]</span>
		</td>
		<td align="center">
			<input  id="office_wdwzj_name_[0]" name="office_wdwzjs|office_wdwzj[0]|office_wdwzj_name" label="姓名"
					value="" maxlength="30" class=" required input_text" style="width:75%"  />
		</td>
		<td align="center">
			<input  id="office_wdwzj_sex_[0]" name="office_wdwzjs|office_wdwzj[0]|office_wdwzj_sex" label="性别" maxlength="1" value="" class=" required input_text" style="width:80%"  />
		</td>
		<td align="center">
			<input  id="office_wdwzj_age_[0]" name="office_wdwzjs|office_wdwzj[0]|office_wdwzj_age" label="年龄" onfocus="InitInput.setNumber(this,3,0,0)"   value="" class="required  input_text" style="width:80%;text-align: right; "  />
		</td>
		<td align="center">
			<input  id="office_wdwzj_positional_[0]" name="office_wdwzjs|office_wdwzj[0]|office_wdwzj_positional" label="职称" value="" maxlength="30" class=" required input_text" style="width:80%"  />
		</td>
		<td align="center">
			<input  id="office_wdwzj_education_name_[0]" name="office_wdwzjs|office_wdwzj[0]|office_wdwzj_education_name" label="学历" value="" maxlength="30" class=" required input_text" style="width:80%"  />
		</td>
		<td align="center">
			<input  id="office_wdwzj_research_expertise_[0]" name="office_wdwzjs|office_wdwzj[0]|office_wdwzj_research_expertise" label="研究专长" value="" maxlength="50" class=" required input_text" style="width:80%"  />
		</td>
		<td align="center">
			<input  id="office_wdwzj_contact_way_[0]" name="office_wdwzjs|office_wdwzj[0]|office_wdwzj_contact_way" label="联系方式" value="" maxlength="30" class=" required input_text" style="width:80%"  />
		</td>
	</tr>


	<c:set value="0" var="index" scope="page"/>
	<x:forEach select="$xmlData/data/office_wdwzjs/office_wdwzj" var="office_wdwzj">

		<c:choose>
			<c:when test="${index<10}" ><c:set value="0" var="flag" scope="page"/></c:when>
			<c:otherwise><c:set value="" var="flag" scope="page"/></c:otherwise>
		</c:choose>
		<tr >
			<td align="center">
				<input type="radio" style="border: 0px;background-color: white;" class="radiobutton" name="selorg_wdwzj" >
			</td>
			<td align="center">
				<span   name="office_wdwzjs/office_wdwzj[${flag}${index}]@seq_no" ><x:out select="$office_wdwzj/@seq_no"/></span>
			</td>
			<td align="center">
				<input  id="office_wdwzj_name_[${flag}${index}]" name="office_wdwzjs/office_wdwzj[${flag}${index}]/office_wdwzj_name"
						label="姓名" maxlength="30"  value="<x:out select="$office_wdwzj/office_wdwzj_name"/>" class=" required input_text" style="width:75%"  />
			</td>
			<td align="center">
				<input  id="office_wdwzj_sex_[${flag}${index}]" name="office_wdwzjs/office_wdwzj[${flag}${index}]/office_wdwzj_sex" label="性别" maxlength="1" value="<x:out select="$office_wdwzj/office_wdwzj_sex"/>" class=" required input_text" style="width:80%"  />
			</td>
			<td align="center">
				<input  id="office_wdwzj_age_[${flag}${index}]" name="office_wdwzjs/office_wdwzj[${flag}${index}]/office_wdwzj_age" label="年龄" onfocus="InitInput.setNumber(this,3,0,0)"  value="<x:out select="$office_wdwzj/office_wdwzj_age"/>" class=" required input_text" style="width:80%;text-align: right; "  />
			</td>
			<td align="center">
				<input  id="office_wdwzj_positional_[${flag}${index}]" name="office_wdwzjs/office_wdwzj[${flag}${index}]/office_wdwzj_positional" label="职称" value="<x:out select="$office_wdwzj/office_wdwzj_positional"/>" maxlength="30" class=" required input_text" style="width:80%"  />
			</td>

			<td align="center">
				<input  id="office_wdwzj_education_name_[${flag}${index}]" name="office_wdwzjs/office_wdwzj[${flag}${index}]/office_wdwzj_education_name" label="学历" value="<x:out select="$office_wdwzj/office_wdwzj_education_name"/>" maxlength="30" class=" required input_text" style="width:80%"  />
			</td>
			<td align="center">
				<input  id="office_wdwzj_research_expertise_[${flag}${index}]" name="office_wdwzjs/office_wdwzj[${flag}${index}]/office_wdwzj_research_expertise" label="研究专长" value="<x:out select="$office_wdwzj/office_wdwzj_research_expertise"/>" maxlength="50" class=" required input_text" style="width:80%"  />
			</td>
			<td align="center">
				<input  id="office_wdwzj_contact_way_[${flag}${index}]" name="office_wdwzjs/office_wdwzj[${flag}${index}]/office_wdwzj_contact_way" label="联系方式" value="<x:out select="$office_wdwzj/office_wdwzj_contact_way"/>" maxlength="30" class=" required input_text" style="width:80%"  />
			</td>
		</tr>
		<c:set value="${index+1}" var="index" scope="page"/>
	</x:forEach>
	</tbody>
</table>

<table id="jbutton" width="98%" align="center" border="0" cellspacing="0" cellpadding="0" style="border:0;">
	<tr ><td>
		<input class="button_02" id="tianjia" name="cmdAddbefore" type=button value="添加" onclick="if(checkTabLimit('tblor_wdwzj',30,'外单位专家信息最多只能填写30条')){addNewRow('tblor_wdwzj');showDateTag('tblor_wdwzj');}try{top.resizeFrame();}catch(e){};changeCss();getLen();attachCheckBuyWay1(this.id)">
		<input class="button_02" name="cmdMovePrev" type=button value="上移" onclick="movePrev('tblor_wdwzj','selorg_wdwzj');changeCss();">
		<input class="button_02" name="cmdMoveNext" type=button value="下移" onclick="moveNext('tblor_wdwzj','selorg_wdwzj');changeCss();">
		<input class="button_02" name="cmddel" type=button  value="删除" onclick="deleteSelectedRow('tblor_wdwzj','外单位专家信息');changeCss();getLen();attachCheckBuyWay1(this.id)">
        <input type='hidden'  name="proposal/total_num_new1" id="yqjfjs1" value="<x:out select="$xmlData/data/proposal/total_num_new1" />">


    </td></tr>
</table>

<div class="t_bar">
	其他成员
</div>
<table  id="tblor_qtcy" cellpadding="0" class="table01 t_css" width="100%" border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;">
	<thead >
	<tr style="border:1px solid #B7D1E6">
		<th class="TblHead" align="center"  width="5%">选择</th>
		<th class="TblHead" align="center"  width="5%">序号</th>
		<th class="TblHead" align="center"  width="10%">姓名</th>
		<th class="TblHead" align="center"  width="10%">性别</th>
		<th class="TblHead" align="center"  width="10%">年龄</th>
		<th class="TblHead" align="center"  width="10%">职称</th>
		<th class="TblHead" align="center"  width="10%">学历</th>
		<th class="TblHead" align="center"  width="10%">研究专长</th>
		<th class="TblHead" align="center"  width="10%">联系方式</th>
	</tr>
	</thead>
	<tbody id="tab1">
	<tr style="display:none">
		<td align="center">
			<input type="radio" style="border: 0px;background-color: white;" class="radiobutton" name="selorg_qtcy" >
		</td>
		<td align="center">
			<span name="office_qtcys|office_qtcy[0]@seq_no" >[index]</span>
		</td>
		<td align="center">
			<input  id="office_qtcy_name_[0]" name="office_qtcys|office_qtcy[0]|office_qtcy_name" label="姓名"
					value="" maxlength="30" class=" required input_text" style="width:75%"  />
		</td>
		<td align="center">
			<input  id="office_qtcy_sex_[0]" name="office_qtcys|office_qtcy[0]|office_qtcy_sex" label="性别" maxlength="1" value="" class=" required input_text" style="width:80%"  />
		</td>
		<td align="center">
			<input  id="office_qtcy_age_[0]" name="office_qtcys|office_qtcy[0]|office_qtcy_age" label="年龄" onfocus="InitInput.setNumber(this,3,0,0)"   value="" class="  input_text required" style="width:80%;text-align: right; "  />
		</td>
		<td align="center">
			<input  id="office_qtcy_positional_[0]" name="office_qtcys|office_qtcy[0]|office_qtcy_positional" label="职称" value="" maxlength="30" class=" required input_text" style="width:80%"  />
		</td>
		<td align="center">
			<input  id="office_qtcy_education_name_[0]" name="office_qtcys|office_qtcy[0]|office_qtcy_education_name" label="学历" value="" maxlength="30" class=" required input_text" style="width:80%"  />
		</td>
		<td align="center">
			<input  id="office_qtcy_research_expertise_[0]" name="office_qtcys|office_qtcy[0]|office_qtcy_research_expertise" label="研究专长" value="" maxlength="50" class=" required input_text" style="width:80%"  />
		</td>
		<td align="center">
			<input  id="office_qtcy_contact_way_[0]" name="office_qtcys|office_qtcy[0]|office_qtcy_contact_way" label="联系方式" value="" maxlength="30" class=" required input_text" style="width:80%"  />
		</td>
	</tr>


	<c:set value="0" var="index" scope="page"/>
	<x:forEach select="$xmlData/data/office_qtcys/office_qtcy" var="office_qtcy">

		<c:choose>
			<c:when test="${index<10}" ><c:set value="0" var="flag" scope="page"/></c:when>
			<c:otherwise><c:set value="" var="flag" scope="page"/></c:otherwise>
		</c:choose>
		<tr >
			<td align="center">
				<input type="radio" style="border: 0px;background-color: white;" class="radiobutton" name="selorg_qtcy" >
			</td>
			<td align="center">
				<span   name="office_qtcys/office_qtcy[${flag}${index}]@seq_no" ><x:out select="$office_qtcy/@seq_no"/></span>
			</td>
			<td align="center">
				<input  id="office_qtcy_name_[${flag}${index}]" name="office_qtcys/office_qtcy[${flag}${index}]/office_qtcy_name"
						label="姓名"  maxlength="30" value="<x:out select="$office_qtcy/office_qtcy_name"/>" class=" required input_text" style="width:75%"  />
			</td>
			<td align="center">
				<input  id="office_qtcy_sex_[${flag}${index}]" name="office_qtcys/office_qtcy[${flag}${index}]/office_qtcy_sex" label="性别" maxlength="1" value="<x:out select="$office_qtcy/office_qtcy_sex"/>" class=" required input_text" style="width:80%"  />
			</td>
			<td align="center">
				<input  id="office_qtcy_age_[${flag}${index}]" name="office_qtcys/office_qtcy[${flag}${index}]/office_qtcy_age" label="年龄" onfocus="InitInput.setNumber(this,3,0,0)"  value="<x:out select="$office_qtcy/office_qtcy_age"/>" class="required  input_text" style="width:80%;text-align: right; "  />
			</td>
			<td align="center">
				<input  id="office_qtcy_positional_[${flag}${index}]" name="office_qtcys/office_qtcy[${flag}${index}]/office_qtcy_positional" label="职称" value="<x:out select="$office_qtcy/office_qtcy_positional"/>" maxlength="30" class=" required input_text" style="width:80%"  />
			</td>

			<td align="center">
				<input  id="office_qtcy_education_name_[${flag}${index}]" name="office_qtcys/office_qtcy[${flag}${index}]/office_qtcy_education_name" label="学历" value="<x:out select="$office_qtcy/office_qtcy_education_name"/>" maxlength="30" class=" required input_text" style="width:80%"  />
			</td>
			<td align="center">
				<input  id="office_qtcy_research_expertise_[${flag}${index}]" name="office_qtcys/office_qtcy[${flag}${index}]/office_qtcy_research_expertise" label="研究专长" value="<x:out select="$office_qtcy/office_qtcy_research_expertise"/>" maxlength="50" class=" required input_text" style="width:80%"  />
			</td>
			<td align="center">
				<input  id="office_qtcy_contact_way_[${flag}${index}]" name="office_qtcys/office_qtcy[${flag}${index}]/office_qtcy_contact_way" label="联系方式" value="<x:out select="$office_qtcy/office_qtcy_contact_way"/>" maxlength="30" class=" required input_text" style="width:80%"  />
			</td>
		</tr>
		<c:set value="${index+1}" var="index" scope="page"/>
	</x:forEach>
	</tbody>
</table>

<table id="jbutton" width="98%" align="center" border="0" cellspacing="0" cellpadding="0" style="border:0;">
	<tr ><td>
		<input class="button_02" id="tianjia" name="cmdAddbefore" type=button value="添加" onclick="if(checkTabLimit('tblor_qtcy',30,'其他人员信息最多只能填写30条')){addNewRow('tblor_qtcy');showDateTag('tblor_qtcy');}try{top.resizeFrame();}catch(e){};changeCss();getLen();attachCheckBuyWay2(this.id)">
		<input class="button_02" name="cmdMovePrev" type=button value="上移" onclick="movePrev('tblor_qtcy','selorg_qtcy');changeCss();">
		<input class="button_02" name="cmdMoveNext" type=button value="下移" onclick="moveNext('tblor_qtcy','selorg_qtcy');changeCss();">
		<input class="button_02" name="cmddel" type=button  value="删除" onclick="deleteSelectedRow('tblor_qtcy','其他人员信息');changeCss();getLen();attachCheckBuyWay2(this.id)">
        <input type='hidden'  name="proposal/total_num_new2" id="yqjfjs2" value="<x:out select="$xmlData/data/proposal/total_num_new2" />">

    </td></tr>
</table>

<div class="t_bar">
	<span class="color_red">*</span>智库负责人和核心成员近三年相关研究成果和应用情况(不超过1000字）
</div>
<table  class="t_css" width="100%" border="0" cellpadding="0" id="research_results_tab" cellspacing="1" >
	<tr>
		<td>
			<textarea id="research_results" name="proposal/research_results" style="width:98%;outline:none;resize:none;" class="input_textarea required maxlength:1000" label="智库负责人和核心成员近三年相关研究成果和应用情况"   rows=10 cols=60><x:out select="$xmlData/data/proposal/research_results" /></textarea>
			<input type="hidden"  name="proposal/research_results_hidden" id="project/research_results_hidden" value="<x:out select="$xmlData/data/proposal/research_results_hidden"  />"/>
		</td>
	</tr>
</table>


<script type="text/javascript">
	$(function() {
		countFundAuto1();
		changeCss();
		attachCheckBuyWay();
		attachCheckBuyWay1();
		attachCheckBuyWay2();
		fileInit_1("tblMileStones1", "PDF", null, "{'PDF':'20480'}");
		$("#tblMileStones1").find(".file").hide();
	});
	function changeCss() {
		$("table.t_css").each(function() {
			$(this).find("tr:even").removeClass().addClass("li_1");
			$(this).find("tr:odd").removeClass().addClass("li_2");
		});
		changeCss1("fundInfo", "tblMileStones1");
	}
	function changeCss1(id1, id2) {
		if ($("#" + id1 + " tr:last").attr("class") == "li_1") {
			$("#" + id2 + " tr").removeClass("li_1").addClass("li_2");
		} else {
			$("#" + id2 + " tr").removeClass("li_2").addClass("li_1");
		}
	}

	function uploadfile(index, i) {
		if (2 == index) {
			$("#proof_file_data").click();

		} else
			$("#card_file").click();
	}
	/* function show(index){
	    $("#kepu").find("#proof_file"+index).show();
	} */
	function fileInit_1(tableId, type, width, validateJson) {
		var imgres = "";

		if (locale == "en_US") {
			imgres = "Upload_EN.gif";

		} else {
			imgres = "Upload_2.gif";

		}
		$("#" + tableId).find(":file").filestyle({
			image : res + "/images/" + imgres,
			imageheight : 25,
			imagewidth : 56,
			width : width
		});
		$("#" + tableId).find(":file").not("#filedata\\[0\\]").each(
				function(i) {
					$(this).change(
							function() {
								var str = $(this).attr("id");
								var index = str.charAt(str.length - 1);
								showFileName_1($(this), tableId, type,
										validateJson, index);
							});
				});
	}

	function showFileName_1(obj, tableId, type, validateJson, index) {
		var max = null;
		var fileTblId = null;// 文件列表的表格id

		fileTblId = tableId;
		var filedata = obj.val();
		if (filedata == '')
			return;
		else if (max != null && $.isNumeric(max) && fileTblId != null
				&& $("#" + fileTblId + " tr:gt(1)").length >= max) {
			var label = "";
			if ($("#" + fileTblId).attr("label") != null)
				label = $("#" + fileTblId).attr("label");

			scmWarn(label + messageTip.canNotUploadMoreThan + max
					+ messageTip.files1);
			return;
		} else {
			var fileName = filedata.substring(filedata.replace(/\\/g, '/')
					.lastIndexOf('/') + 1);
			var end = fileName.substring(fileName.lastIndexOf(".") + 1,
					fileName.length).toUpperCase();
			if (type.indexOf(end) < 0) {
				scmWarn(messageTip.pleaseUpload + type + messageTip.files2,
						"100px");
				return;
			}
		}

		$("#" + tableId + " .file").val(fileName);
		ajaxFileUpload_1(obj, "orgattach", tableId, type, max, validateJson,
				index);
	}

	function ajaxFileUpload_1(obj, type, tblId, filetype, max, validateJson,
			index) {
		irisAjaxFileUpload_1(obj, type, tblId, filetype, max, validateJson,
				index);
	}

	function uploadSuccess_1(obj, data, tableId, filetype, index) {
		$("#" + tableId).find("#file_code" + index).val(
				data[data.length - 1].fileCode);
		$("#" + tableId).find("#file_name" + index).text(
				data[data.length - 1].fileName);
		$("#" + tableId).find("#file_url" + index).attr("href",
				downloadPath + data[data.length - 1].fileCode);
		$("#proof_file" + index).show();
		$("#sy_delConent" + index).show();

		/*              var fileDate = $("#" + tableId).find("span[id='file_date'"+index+"]");// 上传时间对象
		 */
		var fileDate = $("#" + tableId).find("#file_date" + index);// 上传时间对象
		var nowTime = showLocale(new Date());
		fileDate.text(nowTime);
		$("#" + tableId).find("#" + index).show();
	}

	function irisAjaxFileUpload_1(obj, type, tableId, fileType, max,
			validateJson, index) {
		if (type == null || type == '') {
			scmWarn(messageTip.pleaseEnterTypeOfAttachment);
			return;
		}
		$("#" + tableId + " input[type='file']").not(obj).each(function() {
			this.outerHTML = this.outerHTML.replace(/(value=\").+\"/i, "$1\"");
		});

		prcWin.openWin();// 打开遮罩层
		$
				.ajaxFileUpload({
					url : ctx + '/file/ajax-fileupload',// 请求地址
					secureuri : false,// 一般设置为false
					fileElementId : 'filedata',// 文件的id属性
					limitSize : '10',// 允许上传的文件大小,单位M
					allowType : '',// 允许上传的文件类型.
					data : {
						'type' : type,
						'validateJson' : validateJson
					},
					tableId : tableId,// tableID
					dataType : 'json',// 返回值类型
					success : function(data, status) // 服务器成功响应处理函数
					{
						if (data.result == 'error') {
							scmWarn(data.msg);
						} else {

							uploadSuccess_1(obj, data, tableId, fileType, index);

							$("#" + tableId)
									.find(":file")
									.not("#filedata\\[0\\]")
									.each(
											function(i) {
												fileType = "JPG，PNG，DOC，WPS，DOCX，PDF，XLS，XLSX，TIFF，RAR";
												validateJson = "{'JPG':'20480','PNG':'20480','DOC':'20480','WPS':'20480','DOCX':'20480','PDF':'20480','XLS':'20480','XLSX':'20480','TIFF':'20480','RAR':'20480'}";
												$(this).unbind("change");
												$(this)
														.change(
																function() {
																	var str = $(
																			this)
																			.attr(
																					"id");
																	var index = str
																			.charAt(str.length - 1);
																	showFileName_1(
																			$(this),
																			tableId,
																			fileType,
																			validateJson,
																			index);
																});
											});
						}
						prcWin.closeWin();// 关闭遮罩层
					},
					error : function(data, status, e)// 服务器响应失败处理函数
					{
						$("#" + tableId + " input[type='file']").each(
								function(j) {
									this.outerHTML = this.outerHTML.replace(
											/(value=\").+\"/i, "$1\"");
								});

						$("#" + tableId)
								.find(":file")
								.not("#filedata\\[0\\]")
								.each(
										function(i) {
											fileType = "JPG，PNG，DOC，WPS，DOCX，PDF，XLS，XLSX，TIFF，RAR";
											validateJson = "{'JPG':'20480','PNG':'20480','DOC':'20480','WPS':'20480','DOCX':'20480','PDF':'20480','XLS':'20480','XLSX':'20480','TIFF':'20480','RAR':'20480'}";
											$(this).unbind("change");
											$(this)
													.change(
															function() {
																showFileName_1(
																		$(this),
																		"mainGoodsInfo",
																		fileType,
																		validateJson,
																		index);
															});
										});
						if (data && data.responseText && data.responseText.indexOf('413') > -1) {
				scmError("上传的文件超过限制大小！");
			} else {
				scmError(status);
			}
						prcWin.closeWin();// 关闭遮罩层
					},
					complete : function() {
						prcWin.closeWin();// 关闭遮罩层
					}
				});

	}
	 function countFundAuto(idStart, countStr, totalStr) {
 		var indexs = countStr.split(",");
 		var count = 0;
 		for ( var i = 0; i < indexs.length; i++) {
			//
			//var fund=$("input[id='idStart+indexs[i]']").val();
 			var fund = $("#" + idStart+ indexs[i]).val();
 			if (!$.isNumeric(fund))
 				fund = "0";
 			count = ((parseFloat(count)*10000 + parseFloat(fund)*10000)/10000).toFixed(4);

 		}


 		count = formatNumberAuto(count.toString(), 9, 4, 2);// 格式化金额

 		//add by cg 扩展：对于多个输入框所求得的和，同时赋给某几个文本框
 		var totalStrArr = totalStr.split(",");
 		var totalId;
 		for(var i = 0;i < totalStrArr.length; i++ ) {
 			totalId = totalStrArr[i];

 		$("#" + idStart + totalId).val(count);
 		}
 	}
	function delContent_1(tableId, index) {
		if (confirm("你确定要删除该附件？")) {
			/* $("#" + tableId).find("input[id='file_code']").val("");// 清空文件名
			$("#" + tableId).find("span[id='file_date']").text("");// 清空文件code
			$("#" + tableId).find("span[id='file_name']").text("");// 清空文件上传日期
			$("#"+tableId).find("#proof_content").hide(); */

			$("#" + tableId).find("#file_code" + index).val("");// 清空文件名
			$("#" + tableId).find("#file_date" + index).text("");// 清空文件code
			$("#" + tableId).find("#file_name" + index).text("");// 清空文件上传日期
			$("#" + tableId).find("#proof_content" + index).hide();

			$("#sy_delConent" + index).hide();
			$("#file" + index).val("");
			$("#proof_file" + index).hide();

			/* $("#" + tableId).find("#proof_file"+index).hide(); */

		}
	}

	function countFundAuto1() {
		//parseFloat(fund)*10000)/10000).toFixed(4)
		var ta1 =parseFloat(parseFloat($("input[id='office_szwj_quota_[00]']").val()).toFixed(4));

		var ta2 =parseFloat(parseFloat($("input[id='office_szwj_quota_[01]']").val()).toFixed(4));
		var ta3 =parseFloat(parseFloat($("input[id='office_szwj_quota_[02]']").val()).toFixed(4));
		if (!$.isNumeric(ta1) ){
			ta1 = 0;}
		if (!$.isNumeric(ta2) ){
			ta2 = 0;}
		if (!$.isNumeric(ta3) ){
			ta3 = 0;}
		var ta4 =(ta1+ta2+ta3)*0.1;

		//var ta5 =$("#office_szwj_quota").val(ta4)*0.1;
		ta6 = formatNumberAuto(ta4.toString(), 9, 4, 2);
		//var ta =ta6*0.1;
		$("#research_subsidy_funds").val(ta6);

	}

	function countFundAuto2() {
		//parseFloat(fund)*10000)/10000).toFixed(4)
		var ta1 =parseFloat(parseFloat($("input[id='office_zwzj_quota_[00]']").val()).toFixed(4));

		var ta2 =parseFloat(parseFloat($("input[id='office_zwzj_quota_[01]']").val()).toFixed(4));
		var ta3 =parseFloat(parseFloat($("input[id='office_zwzj_quota_[02]']").val()).toFixed(4));
		if (!$.isNumeric(ta1) ){
			ta1 = 0;}
		if (!$.isNumeric(ta2) ){
			ta2 = 0;}
		if (!$.isNumeric(ta3) ){
			ta3 = 0;}
		var ta4 =(ta1+ta2+ta3)*0.1;

		//var ta5 =$("#office_szwj_quota").val(ta4)*0.1;
		ta6 = formatNumberAuto(ta4.toString(), 9, 4, 2);
		//var ta =ta6*0.1;
		$("#research_industrialization_award").val(ta6);

	}
	function countFundAuto3() {
		//parseFloat(fund)*10000)/10000).toFixed(4)
		var ta1 =parseFloat(parseFloat($("input[id='quota_increment']").val()).toFixed(4));

		if (!$.isNumeric(ta1) ){
			ta1 = 0;}

		var ta4 =(ta1)*0.1;

		//var ta5 =$("#office_szwj_quota").val(ta4)*0.1;
		ta6 = formatNumberAuto(ta4.toString(), 9, 4, 2);
		//var ta =ta6*0.1;
		$("#research_support_subsidy_funds").val(ta6);

	}


    function attachCheckBuyWay(id) {
        var tab = document.getElementById("tblorg_hxcy") ;
        var rows = tab.rows.length-1 ;
        if(rows>0){
            $("#yqjfjs").val(rows);
        }else {
            $("#yqjfjs").val('0');
        }
    }

    function attachCheckBuyWay1(id) {
        var tab = document.getElementById("tblor_wdwzj") ;
        var rows = tab.rows.length-1 ;
        if(rows>0){
            $("#yqjfjs1").val(rows);
        }else {
            $("#yqjfjs1").val('0');
        }
    }

    function attachCheckBuyWay2(id) {
        var tab = document.getElementById("tblor_qtcy") ;
        var rows = tab.rows.length-1 ;
        if(rows>0){
            $("#yqjfjs2").val(rows);
        }else {
            $("#yqjfjs2").val('0');
        }
    }
</script>